*Replication code for "Correlates of COVID-19 Vaccine Regret in the United States" (Bayar et al.) 

***
***

*STUDY 1: BRIDGE FUNDING SURVEY

*get data
clear
use "/.../study 1 data FOR REPLICATION.dta"

***

*get study dates
tab EndDate

***

*get median time to complete and N
sum Durationinseconds, d
tab Q1

***

*get number/% vaxed (this is the N for the regret questions)
tab Q28

***

*regret
	*I regret that I decided to get the COVID-19 vaccine. (Q401_1) 
tab Q401_1
	*I believe getting the COVID-19 vaccine was a good decision. (Q402_1)
tab Q402_1
	*My experience with COVID-19 vaccines made me regret getting other vaccines that I got in the past (e.g., flu, measles). (Q401_3) 
tab Q401_3

	*scale the three above
		*flip Q401_1 and  Q401_3 (Q402_1 already runs as it should)
gen regretCOV = (Q401_1 * -1) + 6
gen regretOTH = (Q401_3 * -1) + 6
			*factor: eigen = 2.02826, prop expl var =  0.9453
factor regretCOV Q402_1 regretOTH, ipf
			*make average index: alpha =  0.8432
alpha regretCOV Q402_1 regretOTH, gen(COVIDregret)
		*summarize the index
summarize COVIDregret
tab COVIDregret
		*label it
label variable COVIDregret "Retrospective COVID-19 Vaccine Regret Scale" 

	*bin the regret index into Regret (>3) and & Not Regretful (<3) [note: COVIDregret min = 1, mean = 1.918725, max = 5]
gen COVIDregret_2bin=.
replace COVIDregret_2bin = 0 if COVIDregret<=3
replace COVIDregret_2bin = 1 if (COVIDregret>3 & COVIDregret<=5)
tab COVIDregret COVIDregret_2bin
tab COVIDregret_2bin

***

*correlates
	*future vax intentions
		*Q399 Do you plan on receiving additional COVID-19 boosters going forward, as recommended? (1 = y, 2 = n, 3 = not sure)
			*scale
recode Q399 (1=1) (2=-1) (3=0), gen(Q399_scale)
			*1 = y, 0 = all others
recode Q399 (1=1) (2=0) (3=0), gen(will_get_boosted)
	
		*Based on my experiences, I would discourage others from taking the COVID-19 vaccine or booster shot. (Q401_2) 
tab Q401_2
			*flip to run SD-SA
recode Q401_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q401_2_flip)
			*bin the likert DVs into agree vs all else
recode Q401_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q401_2_2bin)

		*In the event of a future pandemic, I would likely get vaccinated if it was recommended. (Q402_2)
tab Q402_2		
			*flip
recode Q402_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q402_2_flip)
			*bin
recode Q402_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q402_2_2bin)

		*My experience with COVID-19 vaccines made me believe that vaccines in general are safe. (Q402_3) 
tab Q402_3
			*flip
recode Q402_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q402_3_flip)
			*bin
recode Q402_3 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q402_3_2bin)

	*vax behaviors
		*Q403 Have you received an additional dose or booster shot of the COVID-19 vaccine?
tab Q403
			*make 1 = y 0 = n
recode Q403 (1=1) (2=0), gen(Q403_01)

		*recode flu shot to 1 = y 0 = no
recode Q404 (1=1) (2=0), gen(Q404_2bin)

	*views on public health and policy
		*I have confidence in the scientific community. (Q84_1)
tab Q84_1
			*flip
recode Q84_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q84_1_flip)
			*bin
recode Q84_1 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q84_1_2bin)

		*I trust that my tap water is safe to drink. (Q18_10) 
tab Q18_10		
			*flip
recode Q18_10 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q18_10_flip)
			*bin
recode Q18_10 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q18_10_2bin)

		*spending on Scientific research (Q358_4) [1 = increase, 2 = keep same, 4 = decrease]
tab Q358_4	
			*scale it -1 = increase, 0 = same, 1 = decrease [CODING IN NEGATIVE SO IT MAKES MORE SENSE W/ THE T-TEST]
recode Q358_4 (1=-1) (2=0) (4=1), gen(Q358_4_scale)
			*bin the spenidng items into 1 = DEcrease, 0 = stay same + INcrease
recode Q358_4 (1=0) (2=0) (4=1), gen(Q358_4_2bin)

		*spending on The CDC (Q359_3) [1 = increase, 2 = keep same, 4 = decrease]
tab Q359_3
			*scale it -1 = increase, 0 = same, 1 = decrease [CODING IN NEGATIVE SO IT MAKES MORE SENSE W/ THE T-TEST]
recode Q359_3 (1=-1) (2=0) (4=1), gen(Q359_3_scale)
			*bin the spenidng items into 1 = DEcrease, 0 = stay same + INcrease
recode Q359_3 (1=0) (2=0) (4=1), gen(Q359_3_2bin)	

	*CTs
		*The government is working in secret against the rest of us (Q353_5)
tab Q353_5
			*recode gov't working against; code checked = 1, not checked = 0
destring Q353_5, replace
recode Q353_5 (.=0)	
tab Q353_5

		*The dangers of vaccines are being hidden by the medical establishment. (Q17_2) 
tab Q17_2
			*flip
recode Q17_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q17_2_flip)
			*bin
recode Q17_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q17_2_2bin)

	*views on politics and vax skeptical candidates
		*republican party ID: Q9 Generally speaking, do you usually think of yourself as a Republican (2), a Democrat (1), an Independent (3), or something else (4)?
tab Q9
gen pid_REP=0
replace pid_REP=1 if Q9==2
tab Q9 pid_REP	

		*FT Robert F. Kennedy (RFK) Jr. (Q354_24)
summarize Q354_24		

		*FT Donald Trump (Q37_4)
summarize Q37_4	

	*vax mandate
		*Q400 Did an employer, school, or government agency ever require you to get vaccinated for COVID-19? 1=y, 2=n
			*make it 1=y, 0=n
recode Q400 (1=1) (2=0), gen(forced_vax)
tab Q400 forced_vax
			*label it
label variable forced_vax "Required to be Vaccinated"
label define yesno 0 "no" 1 "yes"
label values forced_vax yesno

***

*TABLE 1
	*correlations
spearman COVIDregret Q399_scale Q401_2_flip Q402_2_flip Q402_3_flip Q403_01 Q404_2bin Q84_1_flip Q18_10_flip Q358_4_scale Q359_3_scale Q353_5 Q17_2_flip pid_REP Q354_24 Q37_4 forced_vax, stats(rho p) bonferroni

	*ttests
cls
		*Q399 Do you plan on receiving additional COVID-19 boosters going forward, as recommended? (1 = y, 2 = n, 3 = not sure)
ttest will_get_boosted, by(COVIDregret_2bin)
		*Based on my experiences, I would discourage others from taking the COVID-19 vaccine or booster shot. (Q401_2) 
ttest Q401_2_2bin, by(COVIDregret_2bin)
		*In the event of a future pandemic, I would likely get vaccinated if it was recommended. (Q402_2)
ttest Q402_2_2bin, by(COVIDregret_2bin)
		*My experience with COVID-19 vaccines made me believe that vaccines in general are safe. (Q402_3) 
ttest Q402_3_2bin, by(COVIDregret_2bin)
		*Q403 Have you received an additional dose or booster shot of the COVID-19 vaccine?
ttest Q403_01, by(COVIDregret_2bin)
		*Q404 Have you had a seasonal flu shot in the last 12 months?
ttest Q404_2bin, by(COVIDregret_2bin)
		*I have confidence in the scientific community. (Q84_1)
ttest Q84_1_2bin, by(COVIDregret_2bin)
		*I trust that my tap water is safe to drink. (Q18_10)
ttest Q18_10_2bin, by(COVIDregret_2bin)
		*spending on Scientific research (Q358_4) 
ttest Q358_4_2bin, by(COVIDregret_2bin)	
		*spending on The CDC (Q359_3)	
ttest Q359_3_2bin, by(COVIDregret_2bin)
		*The government is working in secret against the rest of us (Q353_5)
ttest Q353_5, by(COVIDregret_2bin)
		*The dangers of vaccines are being hidden by the medical establishment. (Q17_2) 
ttest Q17_2_2bin, by(COVIDregret_2bin)
		*republican identifiers
ttest pid_REP, by (COVIDregret_2bin)
		*FT Robert F. Kennedy (RFK) Jr. (Q354_24)
ttest Q354_24, by(COVIDregret_2bin)
		*FT Donald Trump (Q37_4)
ttest Q37_4, by(COVIDregret_2bin)
		*Q400 Did an employer, school, or government agency ever require you to get vaccinated for COVID-19
ttest forced_vax, by(COVIDregret_2bin)


****

*FOR SI, TABLE S2: replicate Table 1 above w/ demnographic controls
	
*controls to add
	*sex
recode Q2 (1=0) (2=1), gen(female)
tab Q2 female
label variable female "Sex (Female)"
tab female	

	*race
		*non-white
gen non_white=1
replace non_white=0 if Q3_1=="1"
tab non_white Q3_1
label variable non_white "Race (Non-White)"
		*white (Q3_1)
gen white=0
replace white=1 if Q3_1=="1"
tab Q3_1
tab white
		*black (Q3_2)
gen black=0
replace black=1 if Q3_2=="1"
tab Q3_2
tab black
		*asian am (Q3_3)
gen asian=0
replace asian=1 if Q3_3=="1"
tab Q3_3
tab asian		
		*nat am (Q3_4)
gen nat_am=0
replace nat_am=1 if Q3_4=="1"
tab Q3_4
tab nat_am		
		*hisp/lat (Q4)
recode Q4 (1=1) (2=0), gen(hispanic)
tab Q4 hispanic	
tab hispanic
		*for demog table in SI, get count of white only
gen white_only=0
replace white_only=1 if Q3_1=="1" & Q3_2!="1" & Q3_3!="1" & Q3_4!="1" & Q3_5!="1"
tab white white_only
tab white_only
		*for demog table in SI, get count of black only
gen black_only=0
replace black_only=1 if Q3_1!="1" & Q3_2=="1" & Q3_3!="1" & Q3_4!="1" & Q3_5!="1"
tab black black_only
tab black_only
			
	*Q5 income (no recode needed, but give it a name)
gen income=Q5
label variable income "Income"	
tab income

	*Q6 education (no recode neded, but give it a name)
gen education=Q6
label variable education "Education"	

	*Q7 age
gen age=2024-Q7
tab age
label variable age "Age"
tab age

*run models and and save the resutls of each into a large table
cls
	*Q399 Do you plan on receiving additional COVID-19 boosters going forward, as recommended? (1 = y, 2 = n, 3 = not sure)
reg will_get_boosted COVIDregret female non_white income education age
est store mod1
	*Based on my experiences, I would discourage others from taking the COVID-19 vaccine or booster shot. (Q401_2) 
reg Q401_2_2bin COVIDregret female non_white income education age
est store mod2
	*In the event of a future pandemic, I would likely get vaccinated if it was recommended. (Q402_2)
reg Q402_2_2bin COVIDregret female non_white income education age
est store mod3
	*My experience with COVID-19 vaccines made me believe that vaccines in general are safe. (Q402_3) 
reg Q402_3_2bin COVIDregret female non_white income education age
est store mod4
	*Q403 Have you received an additional dose or booster shot of the COVID-19 vaccine?
reg Q403_01 COVIDregret female non_white income education age
est store mod5
	*Q404 Have you had a seasonal flu shot in the last 12 months?
reg Q404_2bin COVIDregret female non_white income education age
est store mod6
	*I have confidence in the scientific community. (Q84_1)
reg Q84_1_2bin COVIDregret female non_white income education age
est store mod7
	*I trust that my tap water is safe to drink. (Q18_10)
reg Q18_10_2bin COVIDregret female non_white income education age
est store mod8
	*spending on Scientific research (Q358_4)
reg Q358_4_2bin COVIDregret female non_white income education age
est store mod9	
	*spending on The CDC (Q359_3)
reg Q359_3_2bin COVIDregret female non_white income education age
est store mod10
	*The government is working in secret against the rest of us (Q353_5)
reg Q353_5 COVIDregret female non_white income education age
est store mod11
	*The dangers of vaccines are being hidden by the medical establishment. (Q17_2) 
reg Q17_2_2bin COVIDregret female non_white income education age
est store mod12
	*republican identifiers; NOTE: drop pid and ideo in this one
reg pid_REP COVIDregret female non_white income education age
est store mod13
	*FT Robert F. Kennedy (RFK) Jr. (Q354_24)
reg Q354_24 COVIDregret female non_white income education age
est store mod14
	*FT Donald Trump (Q37_4)
reg Q37_4 COVIDregret female non_white income education age
est store mod15
	*Q400 Did an employer, school, or government agency ever require you to get vaccinated for COVID-19
reg forced_vax COVIDregret female non_white income education age
est store mod16
	*now make the large table for the SI
esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 mod10 mod11 mod12 mod13 mod14 mod15 mod16 using "SI_reg_table_study1.rtf", ///
	cells(b(star fmt(2)) se(par fmt(2))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(2 0 1)) ///
	replace
	
***

*for memo (Q398): %/n for... 1 shot of J&J (1), 1 of moderna/pfizer (2), 2 of of moderna/pfizer (3)
tab Q398

***

*for memo: re-run Table 1 excluding the people who only got 1 shot of moderna/pfizer (i.e., KEEP 1 short of J&J and 2 of m/p)
*in other words, replicate Table 3 w/o the people who did not complte a full course of the vaccine
	*make a 0/1 indicator, whereby 1 = kick them out, 0 = keep
recode Q398 (1=0) (2=1) (3=0), gen(not_a_full_course)
tab not_a_full_course
tab not_a_full_course Q398

	*corr
preserve
drop if not_a_full_course==1
spearman COVIDregret Q399_scale Q401_2_flip Q402_2_flip Q402_3_flip Q403_01 Q404_2bin Q84_1_flip Q18_10_flip Q358_4_scale Q359_3_scale Q353_5 Q17_2_flip pid_REP Q354_24 Q37_4 forced_vax, stats(rho p) bonferroni
restore

	*ttests
cls
		*Q399 Do you plan on receiving additional COVID-19 boosters going forward, as recommended? (1 = y, 2 = n, 3 = not sure)
preserve
drop if not_a_full_course==1
ttest will_get_boosted, by(COVIDregret_2bin)
restore
		*Based on my experiences, I would discourage others from taking the COVID-19 vaccine or booster shot. (Q401_2) 
preserve
drop if not_a_full_course==1
ttest Q401_2_2bin, by(COVIDregret_2bin)
restore
		*In the event of a future pandemic, I would likely get vaccinated if it was recommended. (Q402_2)
preserve
drop if not_a_full_course==1
ttest Q402_2_2bin, by(COVIDregret_2bin)
restore
		*My experience with COVID-19 vaccines made me believe that vaccines in general are safe. (Q402_3) 
preserve
drop if not_a_full_course==1
ttest Q402_3_2bin, by(COVIDregret_2bin)
restore
		*Q403 Have you received an additional dose or booster shot of the COVID-19 vaccine?
preserve
drop if not_a_full_course==1
ttest Q403_01, by(COVIDregret_2bin)
restore
		*Q404 Have you had a seasonal flu shot in the last 12 months?
preserve
drop if not_a_full_course==1
ttest Q404_2bin, by(COVIDregret_2bin)
restore
		*I have confidence in the scientific community. (Q84_1)
preserve
drop if not_a_full_course==1
ttest Q84_1_2bin, by(COVIDregret_2bin)
restore
		*I trust that my tap water is safe to drink. (Q18_10)
preserve
drop if not_a_full_course==1
ttest Q18_10_2bin, by(COVIDregret_2bin)
restore
		*spending on Scientific research (Q358_4) 
preserve
drop if not_a_full_course==1
ttest Q358_4_2bin, by(COVIDregret_2bin)
restore	
		*spending on The CDC (Q359_3)	
preserve
drop if not_a_full_course==1
ttest Q359_3_2bin, by(COVIDregret_2bin)
restore
		*The government is working in secret against the rest of us (Q353_5)
preserve
drop if not_a_full_course==1
ttest Q353_5, by(COVIDregret_2bin)
restore
		*The dangers of vaccines are being hidden by the medical establishment. (Q17_2) 
preserve
drop if not_a_full_course==1
ttest Q17_2_2bin, by(COVIDregret_2bin)
restore
		*republican identifiers
preserve
drop if not_a_full_course==1
ttest pid_REP, by (COVIDregret_2bin)
restore
		*FT Robert F. Kennedy (RFK) Jr. (Q354_24)
preserve
drop if not_a_full_course==1
ttest Q354_24, by(COVIDregret_2bin)
restore
		*FT Donald Trump (Q37_4)
preserve
drop if not_a_full_course==1
ttest Q37_4, by(COVIDregret_2bin)
restore
		*Q400 Did an employer, school, or government agency ever require you to get vaccinated for COVID-19
preserve
drop if not_a_full_course==1
ttest forced_vax, by(COVIDregret_2bin)
restore

***
***

*STUDY 2: NOW GET DATA FROM WAVES 1-2 OF SPRING-SUMMER 2024 PANEL STUDY

*get data
clear
use "/.../study 2 data FOR REPLICATION.dta"

***

*get study dates
tab W1_EndDate
tab W2_EndDate

***

*get median time to complete for W1 and W2
sum W1_Durationinseconds, d
sum W2_Durationinseconds, d

***

*get N's for W1 and W2
tab W1_1
tab W2_1

***

*had at least 1 shot?
tab W2_106

***

*regret
	*I regret that I decided to get the COVID-19 vaccine. (W2_114_1) 
tab W2_114_1
	*I believe getting the COVID-19 vaccine was a good decision. (W2_115_1)
tab W2_115_1
	*My experience with COVID-19 vaccines made me regret getting other vaccines that I got in the past (e.g., flu, measles). (W2_114_3) 
tab W2_114_3

	*scale the three above
		*flip Q401_1/"I regret" and  Q401_3/"My experieince" ((Q402_1 already runs as it should)
gen regretCOV = (W2_114_1 * -1) + 6
gen regretOTH = (W2_114_3 * -1) + 6
		*factor: eigen = 2.10765, prop expl var =  0.9599
factor regretCOV W2_115_1 regretOTH, ipf
		*make average index: alpha =   0.8619
alpha regretCOV W2_115_1 regretOTH, gen(COVIDregret)
		*summarize the index
summarize COVIDregret
		*label it
label variable COVIDregret "Retrospective COVID Vaccince Regret"
		*tab
tab COVIDregret

	*bin the regret index into Regret (>3) and & Not Regretful (<=3) [note: COVIDregret min = 1, mean = 1.918725, max = 5]
summarize COVIDregret
gen COVIDregret_2bin=.
replace COVIDregret_2bin = 0 if COVIDregret<=3
replace COVIDregret_2bin = 1 if (COVIDregret>3 & COVIDregret<=5)
tab COVIDregret COVIDregret_2bin
tab COVIDregret_2bin

***

*correlates
	*The threat of COVID-19 has been exaggerated for political purposes (COVCONS_1)
		*flip
recode W1_COVCONS_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(COVCONS_1_flip)
		*bin
recode W1_COVCONS_1 (1=1) (2=1) (3=0) (4=0) (5=0), gen(COVCONS_1_2bin)
	
	*Coronavirus was purposely created and released. (COVCONS_2)
		*flip
recode W1_COVCONS_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(COVCONS_2_flip)
		*bin
recode W1_COVCONS_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(COVCONS_2_2bin)
	
	*The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3)
		*flip
recode W1_COVCONS_3 (1=5) (2=4) (3=3) (4=2) (5=1), gen(COVCONS_3_flip)
		*bin
recode W1_COVCONS_3 (1=1) (2=1) (3=0) (4=0) (5=0), gen(COVCONS_3_2bin)
	
	*The COVID-19 vaccine causes infertility in women and the government is covering this up. (W1_35_1)
		*flip
recode W1_35_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(W1_35_1_flip)
		*bin
recode W1_35_1 (1=1) (2=1) (3=0) (4=0) (5=0), gen(W1_35_1_2bin)
		
	*The global elite are scheming to force people to eat bugs and lab-grown meat (W1_31_1)
		*flip
recode W1_31_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(W1_31_1_flip)
		*bin
recode W1_31_1 (1=1) (2=1) (3=0) (4=0) (5=0), gen(W1_31_1_2bin)
	
	*Corporations secretly poison our food. (W1_35_3) 
		*flip
recode W1_35_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(W1_35_2_flip)
		*bin
recode W1_35_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(W1_35_2_2bin)
		
	*Most people are trustworthy. (Q45_1)
		*flip
recode W1_Q45_1 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q45_1_flip)
		*bin
recode W1_Q45_1 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q45_1_2bin)
	
	*The government can be trusted. (Q45_2)
		*flip
recode W1_Q45_2 (1=5) (2=4) (3=3) (4=2) (5=1), gen(Q45_2_flip)
		*bin
recode W1_Q45_2 (1=1) (2=1) (3=0) (4=0) (5=0), gen(Q45_2_2bin)
	
	*has side effects from COVID shot; W2_116 Did you experience negative side effects from the COVID-19 vaccine 
tab W2_116
		*make this 1 = yes, 0 = no
recode W2_116 (1=1) (2=0), gen(had_side_effects)

***

*TABLE 2
	*correlations
spearman COVIDregret COVCONS_1_flip COVCONS_2_flip COVCONS_3_flip W1_35_1_flip W1_31_1_flip W1_35_2_flip Q45_1_flip Q45_2_flip had_side_effects, stats(rho p) bonferroni

	*ttests
cls
		*The threat of COVID-19 has been exaggerated for political purposes (COVCONS_1)
ttest COVCONS_1_2bin, by(COVIDregret_2bin)
		*Coronavirus was purposely created and released. (COVCONS_2)
ttest COVCONS_2_2bin, by(COVIDregret_2bin)
		*The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3)
ttest COVCONS_3_2bin, by(COVIDregret_2bin)
		*The COVID-19 vaccine causes infertility in women and the government is covering this up. (W1_35_1)
ttest W1_35_1_2bin, by(COVIDregret_2bin)
		*The global elite are scheming to force people to eat bugs and lab-grown meat (W1_31_1)
ttest W1_31_1_2bin, by(COVIDregret_2bin)
		*Corporations secretly poison our food. (W1_35_3) 
ttest W1_35_2_2bin, by(COVIDregret_2bin)
		*Most people are trustworthy. (Q45_1)
ttest Q45_1_2bin, by(COVIDregret_2bin)
		*The government can be trusted. (Q45_2)
ttest Q45_2_2bin, by(COVIDregret_2bin)
		*has side effects from COVID shot; W2_116 Did you experience negative side effects from the COVID-19 vaccine 
ttest had_side_effects, by(COVIDregret_2bin)

***

*for memo: replicate Table 2, removing cases that would not have vaxed if not forced
	*W2_113 Would you still have chosen to receive the vaccine even if you were not required to do so? (1 = y [n = 204], 2 = n [n = 95])
tab W2_113

	*correlations
preserve
drop if W2_113==2
spearman COVIDregret COVCONS_1_flip COVCONS_2_flip COVCONS_3_flip W1_35_1_flip W1_31_1_flip W1_35_2_flip Q45_1_flip Q45_2_flip had_side_effects, stats(rho p) bonferroni
restore

	*ttests
cls
		*The threat of COVID-19 has been exaggerated for political purposes (COVCONS_1)
preserve
drop if W2_113==2
ttest COVCONS_1_2bin, by(COVIDregret_2bin)
restore
		*Coronavirus was purposely created and released. (COVCONS_2)
preserve
drop if W2_113==2
ttest COVCONS_2_2bin, by(COVIDregret_2bin)
restore
		*The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3)
preserve
drop if W2_113==2
ttest COVCONS_3_2bin, by(COVIDregret_2bin)
restore
		*The COVID-19 vaccine causes infertility in women and the government is covering this up. (W1_35_1)
preserve
drop if W2_113==2
ttest W1_35_1_2bin, by(COVIDregret_2bin)
restore
		*The global elite are scheming to force people to eat bugs and lab-grown meat (W1_31_1)
preserve
drop if W2_113==2
ttest W1_31_1_2bin, by(COVIDregret_2bin)
restore
		*Corporations secretly poison our food. (W1_35_3) 
preserve
drop if W2_113==2
ttest W1_35_2_2bin, by(COVIDregret_2bin)
restore
		*Most people are trustworthy. (Q45_1)
preserve
drop if W2_113==2
ttest Q45_1_2bin, by(COVIDregret_2bin)
restore
		*The government can be trusted. (Q45_2)
preserve
drop if W2_113==2
ttest Q45_2_2bin, by(COVIDregret_2bin)
restore
		*has side effects from COVID shot; W2_116 Did you experience negative side effects from the COVID-19 vaccine 
preserve
drop if W2_113==2
ttest had_side_effects, by(COVIDregret_2bin)
restore

***

*FOR SI, TABLE S3: replicate Table 2 above w/ demographic controls

*controls to add
	*sex
recode W1_2 (1=0) (2=1), gen(female)
tab W1_2 female
label variable female "Sex (Female)"	

	*race (non-white)
gen non_white=1
replace non_white=0 if W1_4_1==1
tab W1_4_1
tab non_white 
label variable non_white "Race (Non-White)"	
		*white (W1_4_1)
gen white=0
replace white=1 if W1_4_1==1
tab W1_4_1
tab white
		*black (W1_4_2)
gen black=0
replace black=1 if W1_4_2==1
tab W1_4_2
tab black
		*asian am (W1_4_3)
gen asian=0
replace asian=1 if W1_4_3==1
tab W1_4_3
tab asian		
		*nat am (W1_4_4)
gen nat_am=0
replace nat_am=1 if W1_4_4==1
tab W1_4_4
tab nat_am		
		*hisp/lat (W1_3)
recode W1_3 (1=1) (2=0), gen(hispanic)
tab W1_3 hispanic		
	
	*income (no recode needed, but give it a name)
gen income=W1_5
label variable income "Income"	

	*education (no recode neded, but give it a name)
gen education=W1_6
label variable education "Education"	

	*age
gen age=2024-W1_7
tab age
label variable age "Age"	

*run models and put into one large table for SI
cls
	*The threat of COVID-19 has been exaggerated for political purposes (COVCONS_1)
reg COVCONS_1_2bin COVIDregret female non_white income education age
est store mod1
	*Coronavirus was purposely created and released. (COVCONS_2)
reg COVCONS_2_2bin COVIDregret female non_white income education age
est store mod2
	*The coronavirus is being used to force a dangerous and unnecessary vaccine on Americans. (COVCONS_3)
reg COVCONS_3_2bin COVIDregret female non_white income education age
est store mod3	
	*The COVID-19 vaccine causes infertility in women and the government is covering this up. (W1_35_1)
reg W1_35_1_2bin COVIDregret female non_white income education age
est store mod4
	*The global elite are scheming to force people to eat bugs and lab-grown meat (W1_31_1)
reg W1_31_1_2bin COVIDregret female non_white income education age
est store mod5	
	*Corporations secretly poison our food. (W1_35_3) 
reg W1_35_2_2bin COVIDregret female non_white income education age
est store mod6		
	*Most people are trustworthy. (Q45_1)
reg Q45_1_2bin COVIDregret female non_white income education age
est store mod7	
	*The government can be trusted. (Q45_2)
reg Q45_2_2bin COVIDregret female non_white income education age
est store mod8	
	*has side effects from COVID shot; W2_116 Did you experience negative side effects from the COVID-19 vaccine 
reg had_side_effects COVIDregret female non_white income education age
est store mod9
	*now make the large table for the SI
esttab mod1 mod2 mod3 mod4 mod5 mod6 mod7 mod8 mod9 using "SI_reg_table_study2.rtf", ///
	cells(b(star fmt(2)) se(par fmt(2))) legend label ///
	varlabels(_cons Constant) stats(r2_a aic N, fmt(2 0 1)) ///
	replace

***

*TABLE 3

*[IF YES TO W2_106--vaxed]: W2_112 Did an employer, school, or government agency ever require you to get vaccinated for COVID-19? (1 = y, 2 = n)
tab W2_112
	*make this 1 = y, 0 = no
recode W2_112 (1=1) (2=0), gen(forced_vax)
tab forced_vax

*[IF YES TO W2_112--forced]: W2_113 Would you still have chosen to receive the vaccine even if you were not required to do so? (1 = y, 2 = n)
tab W2_113
	*make this this 1 = yes, 0 = no
recode W2_113 (1=1) (2=0), gen(yes_if_not_forced)
tab yes_if_not_forced

*percent regretful for required (or not) and would have chosen (or not) if not required
ttest COVIDregret_2bin, by (forced_vax)
ttest COVIDregret_2bin, by (yes_if_not_forced)

*mean VRI by...
cls
	*Not required by employer, school, or government agency to get vaccinated for COVID-19
	*Required by employer, school, or government agency to get vaccinated for COVID-19
		*ttest on full VRI scale
ttest COVIDregret, by(forced_vax)	

	*Would have chosen to receive the vaccine even if not required
	*Would not have chosen to receive the vaccine if not required 
		*ttest on full VRI scale
ttest COVIDregret, by(yes_if_not_forced)

	*not required versus Would have chosen to receive the vaccine even if not required
		*make indicator, where 1 = not required and 0 = Would have chosen to receive the vaccine even if not required
gen temp_comp1=.
replace temp_comp1=1 if forced_vax==0
replace temp_comp1=0 if yes_if_not_forced==1
		*ttest
ttest COVIDregret, by(temp_comp1)

	*not required verus Would not have chosen to receive the vaccine if not required versus 
		*make indicator, where 1 = not required and 0 = Would not have chosen to receive the vaccine if not required versus
gen temp_comp2=.
replace temp_comp2=1 if forced_vax==0
replace temp_comp2=0 if yes_if_not_forced==0
		*ttest
ttest COVIDregret, by(temp_comp2)

***
***

*FOR SI: POOLED DATA FOR REGRET BY DEMOGS TABLE

*get data
clear
use "/.../pooled data for regret by demographics SI table FOR REPLICATION.dta"

***

*analysis of regret
	*all participants
tab COVIDregret_2bin

	*by age (make categories first)
gen age_cat=.
replace age_cat=1 if age<=24
replace age_cat=2 if (age>=25 & age <=34)
replace age_cat=3 if (age>=35 & age <=44)
replace age_cat=4 if (age>=45 & age <=54)
replace age_cat=5 if (age>=55 & age <=64)
replace age_cat=6 if age>=65
tab age age_cat
tab age_cat COVIDregret_2bin, row

	*by sex
tab female COVIDregret_2bin, row

	*by ed
tab education COVIDregret_2bin, row

	*by race
tab white COVIDregret_2bin, row
tab black COVIDregret_2bin, row
tab asian COVIDregret_2bin, row
tab nat_am COVIDregret_2bin, row
tab hispanic COVIDregret_2bin, row

	*by income
tab income COVIDregret_2bin, row

	*by party identification
tab demrep7 COVIDregret_2bin, row
